/***
 * table组件 定制了表头样式
 */
import React, {Component}from 'react';
import {Table} from 'antd';
import config from '../config';
require('./components-css.less');

class MyTable extends Component {

    componentDidMount () {

    }

    render () {
        if (this.props.columns && this.props.columns.length !== 0) {
            for (let i = 0; i < this.props.columns.length; i++) {
                this.props.columns[i].className =
                    this.props.columns[i].className ? this.props.columns[i].className + ' wp-myTable' : 'wp-myTable';
            }
        } else {
            console.log('MyTable: columns 值为 ' + this.props.columns)
        }
        return (
            <div className="xnw-table">
                <Table {...this.props} />
            </div>
        )
    }
}

export default MyTable;
